package com.wkg.lotterysystem.service.dto;

import com.wkg.lotterysystem.service.enums.ActivityPrizeStatusEnum;
import com.wkg.lotterysystem.service.enums.ActivityPrizeTiersEnum;
import com.wkg.lotterysystem.service.enums.ActivityStatusEnum;
import com.wkg.lotterysystem.service.enums.ActivityUserStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {
    //活动信息

    private Integer activityId;
    private String activityName;
    private String desc;
    private ActivityStatusEnum status;

    public Boolean valid() {
        return status.equals(ActivityStatusEnum.RUNING);
    }


    //奖品信息（列表）
    private List<PrizeDTO> prizeDTOList;

    //人员信息（列表）
    private List<UserDTO> userDTOList;


    @Data
    public static class PrizeDTO {
        private Integer priceId;

        private String name;

        /**
         * 图片索引
         */
        private String imageUrl;

        private BigDecimal price;

        private String description;
        /**
         * 奖品等级
         */
        private ActivityPrizeTiersEnum tiers;

        /**
         * 奖品等级
         */
        private Integer prizeAmount;

        /**
         * 奖品状态
         */
        private ActivityPrizeStatusEnum status;

        public Boolean valid() {
            return status.equals(ActivityPrizeStatusEnum.INIT);
        }
    }

    @Data
    public static class UserDTO {
        /**
         * 用户id
         */
        private Integer userId;
        /**
         * 用户名称
         */
        private String userName;

        /**
         * 用户状态
         */
        private ActivityUserStatusEnum status;

        public Boolean valid() {
            return status.equals(ActivityUserStatusEnum.INIT);
        }
    }
}
